<div class="contents">
  <ol class="breadcrumb">
    <li><a href="#/index/panel">首页</a></li>
    <li><a href="#/neworder/chanping/myorder/incomplete/list?m=01">我的未完成订单列表</a>
    </li>
    <li class="active">{{item.oPName}}</li>
    <li class="active">订单详情</li>
  </ol> 
  
  <form class="form-horizontal" role="form" name="form" ng-submit="save()" novalidate>
  <table class="table table-striped table-bordered">
    <tbody> 
      <tr>
        <td width="140">订单ID</td> <td width="400">{{item.id}}</td>
        <td width="140">订单号</td> <td width="400">{{item.oCode}}</td>
       </tr>
     
      <tr>
        <td >订单金额</td> <td >{{item.oAmount | moneyRender2}}</td> 
        <td>当前状态</td> <td class="order-status-{{item.oStatus}}" >{{item.oStatus | orderStatusRender}}</td> 
      </tr>
      <tr>
        <td >产品简称</td> <td ><a href="#/product/view?id={{item.oProjectId}}">{{item.oPName}}</a></td>
        <td>理财师FAID</td><td >{{item.oFAId}}</td>
      </tr>
      <tr>
         <td>客户姓名</td> <td >{{item.oCName}}</td>
         <td>预约时间</td> <td >{{item.createDate | date:'yyyy-MM-dd HH:mm'}}</td>
      </tr>
      <tr>
        <td>预约成功时间</td> <td >{{item.yuYueChengGongDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.yuYueChengGongBy}}</td> 
      </tr>
      <tr>
        <td>合同寄出时间</td> <td >{{item.heTongJiChuDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.heTongJiChuBy}}</td> 
      </tr>
      <tr>
        <td>签约打款时间</td> <td >{{item.qianYueDaKuanDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.qianYueDaKuanBy}}</td> 
      </tr>
      <tr>
        <td>确认到款时间</td> <td >{{item.queRenDaKuanDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.queRenDaKuanBy}}</td> 
      </tr>
      <tr>
        <td>佣金到账时间</td> <td >{{item.yongJinDaoZhangDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.yongJinDaoZhangBy}}</td> 
      </tr>
      <tr>
        <td>财务结佣时间</td> <td >{{item.caiWuJieYongDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.caiWuJieYongBy}}</td> 
      </tr>
      <tr>
        <td>确认返佣时间</td> <td >{{item.queRenFanYongDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.queRenFanYongBy}}</td> 
      </tr>
      <tr>
        <td>确认提交有效合同</td> <td >{{item.queRenHeTongDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.queRenHeTongBy}}</td> 
      </tr>

      <tr>
        <td>机构价</td> <td >{{item.oSellingPrice | profitRender}}</td> 
        <td>后端机构价</td> <td >{{item.oBackSellingPrice| profitRender}}</td> 
      </tr>
      <tr>
        <td>渠道核心返佣额</td> <td >{{item.oSellingRebate | moneyRender2:1:1}}</td> 
        <td>后端渠道核心返佣额</td> <td >{{item.oBackSellingRebate | moneyRender2:1:1}}</td> 
      </tr>
      <tr>
        <td>挂网价</td> <td >{{item.oRebateRate | profitRender}}</td> 
        <td>后端挂网价</td> <td >{{item.oBackRebateRate| profitRender}}</td> 
      </tr>
      <tr>
        <td>挂网返佣额</td> <td >{{item.oRebateAmount | moneyRender2:1:1}} </td> 
        <td>后端挂网返佣额</td> <td >{{item.oBackRebateAmount | moneyRender2:1:1}}</td> 
      </tr>
      <tr ><td>成交价</td> 
          <td ng-if="item.oStatus == '110'"> 
            <input type="text" class="form-control" placeholder="成交价(不带百分号)" ng-model="item.oTransactionPrice"  required="required" only-num ng-pattern="/^\d{1,}\.?\d{0,2}$/">
         </td> 
          <td ng-if="item.oStatus != '110'">{{item.oTransactionPrice | profitRender}}</td>

        <td>后端成交价</td>
         <td ng-if="item.oStatus == '110'">
            <input type="text" class="form-control"  placeholder="后端成交价(不带百分号)" ng-model="item.oBackTransactionPrice"  required="required" only-num ng-pattern="/^\d{1,}\.?\d{0,2}$/">
        </td> 
        <td ng-if="item.oStatus != '110'">{{item.oBackTransactionPrice | profitRender}}</td>
      </tr>
      <tr >
          <td>成交返佣额</td> 
          <td ng-if="item.oStatus == '110'">{{(item.oTransactionPrice * item.oAmount / 100) | moneyRender2:1:1}}</td>
          <td ng-if="item.oStatus != '110'">{{ item.oTransactionRebate | moneyRender2:1:1}}</td>
          <td>后端成交返佣额</td> 
          <td ng-if="item.oStatus == '110'">
          
          {{(item.oBackTransactionPrice * item.oAmount / 100) | moneyRender2:1:1}} 
          </td> 
          <td ng-if="item.oStatus != '110'">
          {{item.oBackTransactionRebate | moneyRender2:1:1}}
          </td> 
      </tr>
      
      <tr>
        <td>打款人</td>
        <td ng-if="item.oStatus == '240' || item.oStatus == '250'">
            <input type="text"  ng-class="{'new-error-css':form.upstreamHitman.$invalid}" class="form-control" name="upstreamHitman" placeholder="打款人" ng-model="item.upstreamHitman"  required="required" >
        </td>   
        <td ng-if="item.oStatus != '240' && item.oStatus != '250'">{{item.upstreamHitman}}</td> 

        <td>打款账号(尾数四位数)</td>
        <td ng-if="item.oStatus == '240' || item.oStatus == '250'">
            <input type="text" class="form-control" ng-class="{'new-error-css':form.upstreamHitmanNum.$invalid}" name="upstreamHitmanNum" placeholder="打款账号(尾数四位数)" ng-model="item.upstreamHitmanNum"  required="required" >
        </td>
         <td ng-if="item.oStatus != '240' && item.oStatus != '250'">{{item.upstreamHitmanNum}}</td> 
      </tr>

      <tr>
        <td>寄出合同编号</td>
        <td ng-if="item.oStatus == '240' || item.oStatus == '250'">
            <input type="text" class="form-control" ng-class="{'new-error-css':form.sendContractNum.$invalid}" name="sendContractNum" placeholder="寄出合同编号" ng-model="item.sendContractNum"  required="required" >
        </td>
         <td ng-if="item.oStatus!= '240' && item.oStatus != '250'">{{item.sendContractNum}}</td> 
        <td>收回合同编号</td> 
        <td ng-if="item.oStatus == '330'">
            <input type="text" class="form-control" ng-class="{'new-error-css':form.receiveContractNum.$invalid}" name="receiveContractNum" placeholder="收回合同编号" ng-model="item.receiveContractNum"  required="required" >
        </td>
        <td ng-if="item.oStatus != '330'">{{item.receiveContractNum}}</td> 
      </tr>

      <tr>
        <td>结佣额(上游/单位：元)</td>
        <td ng-if="item.oStatus == '240' || item.oStatus == '250'">
            <input type="number" class="form-control" ng-class="{'new-error-css':form.confirmForntAmount.$invalid}" name="confirmForntAmount" placeholder="(上游)结佣额" ng-model="item.confirmForntAmount"  required="required" >
            <span class="form-control-feedback">元</span>
        </td>
        <td ng-if="item.oStatus!= '240' && item.oStatus != '250'">{{item.confirmForntAmount | moneyRender2:1:1}}</td> 
        <td>后端结佣额(上游/单位：元)</td> <td >{{item.confirmBackAmount | moneyRender2:1:1}}</td> 
      </tr>

      <tr>
        <td>其他结款额(上游/单位：元)</td>
        <td ng-if="item.oStatus == '240' || item.oStatus == '250'">
            <input type="number" class="form-control" ng-class="{'new-error-css':form.confirmOtherAmount.$invalid}" name="confirmOtherAmount" placeholder="其他结款额" ng-model="item.confirmOtherAmount"  required="required" >
            <span class="form-control-feedback">元</span>
        </td>
       <td ng-if="item.oStatus!= '240' && item.oStatus != '250'">{{item.confirmOtherAmount | moneyRender2:1:1}}</td> 
        <td>其他结款说明(上游)</td>
        <td ng-if="item.oStatus == '240' || item.oStatus == '250'">
            <input type="text" class="form-control" ng-class="{'new-error-css':form.comfirmOtherSectionDesc.$invalid}" name="comfirmOtherSectionDesc" placeholder="其他结款说明" ng-model="item.comfirmOtherSectionDesc"  required="required" >
        </td>
       <td ng-if="item.oStatus != '240' && item.oStatus != '250'">{{item.comfirmOtherSectionDesc}}</td> 
      </tr>
      
      <tr>
        <td>财务前端结佣</td> <td >{{item.oFinanceFrontRebate | moneyRender2:1:1}}</td> 
        <td>财务后端结佣</td> <td >{{item.oFinanceBackRebate | moneyRender2:1:1}}</td> 
      </tr>
      <tr>
        <td>活动打款(财务/单位：元)</td> 
        <td >
           {{item.oActivityAmount | moneyRender2:1:1}}
        </td>
        <td>活动打款说明(财务)</td>
          <td >
           {{item.oPlaySectionDesc}}
         </td>
      </tr>
      <tr>
        <td>其他打款额(财务/单位：元)</td> <td >{{item.oFinanceOtherAmount | moneyRender2:1:1}}</td> 
        <td>其他打款说明(财务)</td> <td >{{item.oFinancOtherAmountDesc}}</td> 
      </tr>

      <tr>
        <td>上传合同凭证</td> 

        <td ng-if="item.oStatus != '330'">
            <input type="text" class="form-control"  placeholder="上传合同凭证" id="advertLinkInput" name="oFrontContractDocument" ng-model="item.oFrontContractDocument" readonly="true"   >
        </td>
        <td ng-if="item.oStatus == '330'">
            <input type="text" class="form-control" ng-class="{'new-error-css':form.oFrontContractDocument.$invalid}" placeholder="上传合同凭证" id="advertLinkInput" name="oFrontContractDocument" ng-model="item.oFrontContractDocument" readonly="true"  required="required" >
        </td>
        <td ng-if="item.oStatus == '330'"><div class="btn btn-primary add-pic-btn" >上传图片</div></td>
        <td ng-if="item.oStatus != '330'"><div class="btn btn-primary add-pic-btn" disabled="disabled" >上传图片</div></td>      
         <td ></td> 
      </tr>
      <tr>
        <td>前端结佣方式</td>
        <td>{{item.oRebateType | oRebateTypeRender}}{{item.oYouDanRebateType | oRebateTypeRender}}</td>
        <td>后端结佣方式</td>
        <td>{{item.oBackRebateType | oRebateTypeRender}}</td>
      </tr>
      <tr>
        <td>前端线下打款银行</td>
        <td>{{item.oRebateBankId}}</td>
        <td>后端线下打款银行</td>
        <td>{{item.oBackRebateBankId}}</td>
      </tr>
      <tr>
        <td>前端线下打款姓名</td>
        <td>{{item.oRebateBankCardHolder}}</td>
        <td>后端线下打款姓名</td>
        <td>{{item.oBackRebateBankCardHolder}}</td>
      </tr>
      <tr>
        <td>前端线下打款银行号</td>
        <td>{{item.oRebateBankCardNumber}}</td>
        <td>后端线下打款银行号</td>
        <td>{{item.oBackRebateBankCardNumber}}</td>
      </tr>
      <tr ng-if="item.oYouDanRebateType == 1">
        <td>用户自提状态</td>
        <td>{{item.oYouDanOperateType | operateTypeModelRenter}}</td>
        <td></td>
        <td></td>
      </tr>
      <tr ng-if="item.oRebateType == 1 || item.oBackRebateType == 1">
        <td><span ng-if="item.oRebateType == 1">前端用户自提状态</span></td>
        <td><span ng-if="item.oRebateType == 1">{{item.oRebateOperateType | operateTypeModelRenter}}</span></td>
        <td><span ng-if="item.oBackRebateType == 1">后端用户自提状态</span></td>
        <td><span ng-if="item.oBackRebateType == 1">{{item.oBackRebateOperateType | operateTypeModelRenter}}</span></td>
      </tr>
      <tr>
        <td>结款类型</td> 
        <td ng-if="item.oStatus == '110'">
        <select class="form-control" placeholder="订单状态" name="" ng-model="item.oKnotType"  ng-options="m.value as m.text for m in dictMap.knotTypeModel" ><option value="">--结款类型--</option></select> 
        </td> 
        <td ng-if="item.oStatus!= '110'">
           {{item.oKnotType | oKnotTypeRender}}
        </td>
        
        <td>订单备注</td> <td >{{item.oRemark}}</td> 
      </tr>
      <tr>
        <td>订单是否有效</td> 
        <td class="order-defriend-status-{{item.oDefriendStatus}}" colspan="3">{{item.oDefriendStatus | orderDefriendStatusRender}}(百万冲十亿活动状态)</td> 
        
      </tr>
      

      <tr>
        <td>相关操作</td>
        <td colspan="3">
         
         <div  class="btn btn-primary" disabled="disabled" ng-if="item.oStatus == '320'">等待返佣确认</div>
          <div  class="btn btn-primary" disabled="disabled" ng-if="item.oStatus == '210'">等待打款</div>
          <div  class="btn btn-primary" ng-click="applySuccess()" ng-if="item.oStatus == '110'">预约成功</div>

          <div  class="btn btn-red"   ng-click="showVisitLayer()" ng-if="item.oStatus < '310' && item.oStatus != '140'">订单失败</div>

          <div  class="btn btn-primary" ng-click="sendContract()" ng-if="item.oStatus == '130'">寄出合同</div>

          <div  class="btn btn-warning" ng-click="process(220)" ng-if="item.oStatus == '210'" ng-confirm-click="请确认已得到理财师的同意,并代之操作'已签约打款'?">已签约打款</div>

          <div  class="btn btn-primary" ng-click="comfirmPay()" ng-if="item.oStatus == '220'">确认到款</div>

          <div  class="btn btn-primary" ng-click="frontRabite()" ng-if="item.oStatus == '240' || item.oStatus == '250'">佣金到账</div>
         
          <div  class="btn btn-primary" disabled="disabled" ng-if="item.oStatus == '310'">财务结佣</div>
          
          <div  class="btn btn-warning" disabled="disabled" ng-click="comfirmFrontRabite()" ng-if="item.oStatus == '320'">确认返佣</div>

          <div  class="btn btn-primary" ng-click="takeEffectiveContract()" ng-if="item.oStatus == '330'">提交有效合同</div>
          
          <div  class="btn btn-primary" ng-click="avail(item.oDefriendStatus == '2' ? '1' : '2')" ng-if="item.oStatus < 310 || item.oStatus=='330'">{{item.oDefriendStatus == "2" ? "标识为有效订单" : "标识为无效订单"}}</div>

        </td>
    </tr>
    </tbody>
  </table> 
  </form>

<div class="layer-box" ng-show="isShowVisitLayer">
  <div class="layer-bg"></div>
  <div class="layer-con " style="padding:10px 20px; width:450px; left:40%">
    <span class="icons-close" title="关闭" ng-click="isShowVisitLayer = false;">X</span>
    <div class="layer-title">
      FAID:{{item.oFAId}}
    </div>
    <div class="con-wrap">
      <div class="form-group" >
<form class="form-horizontal" role="form" name="itll" ng-submit="save()" novalidate>
        <table class="table table-striped table-bordered">
          <tr>
            <td width="120px">操作人</td>
            <td width="120px">操作时间</td>
            <td width="190px">失败原因</td>
          </tr>

          <tr ng-if="item.oStatus=='888'">
            <td>{{item.updateBy}}</td>
            <td>{{item.updateDate}}</td>
            <td>{{item.oCancelReason}}</td>
          </tr>
        </table>


        <table class="table table-striped table-bordered">
          
          <tr>
            <td><input type="text"  ng-class="{'new-error-css':itll.oCancelReason.$invalid}" name="oCancelReason" class="form-control" placeholder="订单失败原因" ng-model="item.oCancelReason" required="required" /></td>
            <td>
              <input type="button" value="确认失败"  class="btn btn-small btn-warning" ng-click="confirmFailure()" />
            </td>
          </tr>
        </table>
      </form>
      </div>
    </div>
  </div>
</div> 



</div>
<div load-script src="'/static/jquery.jUploader-1.01.js?7'" call-back="" charset="utf-8" ></div>
